//
//  UIImageView+XMSDWebImage.m
//  Fireball
//
//  Created by 俞渊华 on 2017/12/4.
//  Copyright © 2017年 俞渊华. All rights reserved.
//

#import "UIImageView+XMSDWebImage.h"

@implementation UIImageView (XMSDWebImage)
-(void)xm_setImageWithURL:(NSString *)urlStr{
    [self xm_setImageWithURL:urlStr placeholderImage:nil completed:nil];
}
-(void)xm_setImageWithURL:(NSString *)urlStr placeholderImage:(UIImage *)placeholder{
    [self xm_setImageWithURL:urlStr placeholderImage:placeholder completed:nil];
}
-(void)xm_setImageWithURL:(NSString *)urlStr completed:(SDExternalCompletionBlock)completedBlock{
    [self xm_setImageWithURL:urlStr placeholderImage:nil completed:completedBlock];
}
-(void)xm_setImageWithURL:(NSString *)urlStr placeholderImage:(UIImage *)placeholder completed:(SDExternalCompletionBlock)completedBlock{
    
    NSURL * url = [NSURL URLWithString:[urlStr stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding]];
    
    [self sd_setImageWithURL:url placeholderImage:placeholder completed:completedBlock];
}

@end
